<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title>菜鸟教程(runoob.com)</title>
  <style>
    div {
      width: 100px;
      height: 100px;
      background: red;
      position: relative;
      /* animation: mymove 3s; */
      animation: yourMove 4s;
      animation-iteration-count: infinite;
      animation-fill-mode: forwards;

      /* Safari 和 Chrome */
      /* -webkit-animation: mymove 3s; */
      /* -webkit-animation-iteration-count: 2;
      -webkit-animation-fill-mode: backwards; */
    }

    /* @keyframes mymove {
      from {
        top: 0px;
      }

      to {
        top: 200px;
      }
    } */

    @keyframes yourMove {
      0% {
        top: 0;
        left: 0;
      }

      25% {
        left: 100px;
        top: 0;
      }

      50% {
        left: 100px;
        top: 100px;
      }

      75% {
        left: 0;
        top: 100px;
      }

      100% {
        left: 0;
        top: 0;
      }
    }

    @-webkit-keyframes mymove

    /* Safari 和 Chrome */
      {
      from {
        top: 0px;
      }

      to {
        top: 200px;
      }
    }
  </style>
</head>

<body>

  <p><strong>注意：</strong>Internet Explorer 9 及其之前的版本不支持 animation-fill-mode 属性。</p>

  <div></div>

</body>

</html>